<?php
/**
 * User: YL
 * Date: 2019/09/16
 */

namespace App\Common\Models;

use App\Common\ConstAttribute;
use Jenssegers\Mongodb\Eloquent\Model;
use restful\traits\RestfulModel;

/**
 * @method RestfulModel initialize()
 */
class BaseMongo extends Model implements ConstAttribute
{
    use RestfulModel;

    protected function initializeBefore()
    {
        // 设置链接为 mongodb
        $this->connection = 'mongodb';
        // 设置表名称
        $this->setTable(static::getSnakePluralName());
    }
}
